import type { AxiosRequestConfig, AxiosResponse } from 'axios'

//1:请求及相应拦截器
export interface CrvRequestInterceptor<T = AxiosResponse> {
  requestInterceptor?: (config: AxiosRequestConfig) => AxiosRequestConfig
  requestInterceptorCatch?: (error: any) => any
  resposeInterceptor?: (res: T) => T
  resposeInterceptorCatch?: (error: any) => any
}

//2:请求参数
export interface CrvRequestConfig<T = AxiosResponse>
  extends AxiosRequestConfig {
  crvInterceptors?: CrvRequestInterceptor<T>
}
